package com.softer.wxzj.service.impl;

import com.github.pagehelper.PageInfo;
import com.softer.wxzj.common.entity.CommonResult;
import com.softer.wxzj.common.entity.Page;
import com.softer.wxzj.entity.SysCorpOperator;
import com.softer.wxzj.mapper.SysCorpOperatorMapper;
import com.softer.wxzj.service.SysCorpOperatorService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @description: 企业用户信息
 * @ClassName: SysCorpOperatorService
 * @author: zcz
 * @date: 2019-05-10
 */
@Service
@Slf4j
public class SysCorpOperatorServiceImpl implements SysCorpOperatorService {

    @Autowired
    private SysCorpOperatorMapper sysCorpOperatorMapper;

    @Override
    public CommonResult delete(String id) {
        int num = sysCorpOperatorMapper.delete(id);
        return CommonResult.ResponseResult(num);
    }

    @Override
    public PageInfo<SysCorpOperator> getList(Page page, SysCorpOperator sysCorpOperator) {
        return null;
    }

    /**
     * 生成   随机数
     * TODO 确定位数 -1
     *
     * @return
     */
    private static String getRandom() {
        return (long) ((Math.random() * 9 + 1) * 10000) + "";
    }


    @Override
    public CommonResult insert(SysCorpOperator sysCorpOperator) {
        return null;
    }

    @Override
    public CommonResult update(SysCorpOperator sysCorpOperator) {
        int num = sysCorpOperatorMapper.update(sysCorpOperator);
        return CommonResult.ResponseResult(num);
    }



    @Override
    public SysCorpOperator getInfo(String id) {
        return sysCorpOperatorMapper.getInfo(id);
    }

    @Override
    public PageInfo<SysCorpOperator> findList(Page page, SysCorpOperator sysCorpOperator, String fuzzy) {
        return null;
    }
}
